package ynu.edu.controller;


import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import ynu.edu.common.controller.LogicController;
import ynu.edu.dao.ShopItemDao;
import ynu.edu.entity.ShopItem;
import ynu.edu.service.ShopItemService;

import java.util.List;

@Api(tags = "商店商品实体的控制器")
@RestController
@RequestMapping("/shopItem")
public class ShopItemController extends LogicController<ShopItemService, ShopItemDao, ShopItem,Long> {
    public ShopItemController(@Autowired ShopItemService service){
        super(service);
    }
    @GetMapping("/getShopItems")
    public List<ShopItem> getShopItems(@RequestParam("id")Long id){
        return getService().getAllShopItem(id);
    }
}